package org.wzq.data;

import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * author:wzq
 * project:spring_in_action
 * date:16-5-9
 */
@Component
public class SpittleRepositoryImpl implements SpittleRepository {
    public List<Spittle> findSpittles(int count) {
        return createspittelist(count);
    }

    private List<Spittle> createspittelist(int count) {
        List<Spittle> list = new ArrayList<Spittle>();
        for (int i = 0; i < count; i++) {
            list.add(new Spittle("Spittle " + i, new Date()));
        }
        return list;
    }
}
